<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/template.xhtml">

	<ui:define name="title">Consultar País
		<f:event listener="#{paisBean.initialize}" type="preRenderView"></f:event>
	</ui:define>

	<ui:define name="pageName">Consultar País</ui:define>

	<ui:define name="content">
		<div style="margin-left: 15%; float: left; width: 70%">
			<h:panelGrid columns="2">
				<h:outputText value="Código:" />
				<h:outputText value="País" />

				<h:inputText style="width:100px;" />
				<h:inputText style="width:250px;" />
			</h:panelGrid>

			<div style="width: 74%; padding-top: 10px; text-align: right;">
				<p:commandButton value="Consultar" style="height:28px;" />
				<p:commandButton value="Novo" style="height:28px;"
					actionListener="#{paisBean.changeToNew}" />
				<p:commandButton value="Limpar" style="height:28px;" />
			</div>

			<div style="padding-top: 10px;" id="divTable">
				<p:dataTable style="width:700px" var="pais"
					value="#{paisBean.paises}" id="tablePais">
					<p:column headerText="Código" style="width:100px;">
						<h:outputText value="#{pais.id}" />
					</p:column>

					<p:column headerText="País">
						<h:outputText value="#{pais.pais}" />
					</p:column>

					<p:column headerText="Sigla" width="50">
						<h:outputText value="#{pais.sigla}" />
					</p:column>

					<p:column headerText="DDI" width="50">
						<h:outputText value="#{pais.ddi}" />
					</p:column>

					<p:column headerText="" width="50">
						<p:commandButton icon="ui-icon-pencil"
							actionListener="#{paisBean.changeToEdit(pais.id)}"
							style="width: 24px; height: 24px;" />
						<p:spacer width="10px" />
						<p:commandButton icon="ui-icon-trash"
							actionListener="#{paisBean.changeToDelete(pais.id)}"
							style="width: 24px; height: 24px;" />
					</p:column>
				</p:dataTable>
			</div>
		</div>
	</ui:define>

	<ui:define name="popups">
		<ui:include src="formPais.xhtml"></ui:include>
	</ui:define>
</ui:composition>